{extend name="layout:base" /}
{block name="main_content"}
<div class="row maintop">
  <div class="col-xs-4 col-sm-2">
    <a href="{:url('[admin.auth.adminer.create]')}">
      <button class="btn btn-sm btn-primary">
        <i class="ace-icon fa fa-plus bigger-110"></i>添加管理员
      </button>
    </a>
  </div>
  <div class="col-xs-10 col-sm-5">
    <form name="form_search" class="form-search" method="get">
      <div class="input-group">
        <span class="input-group-addon">
          <i class="ace-icon fa fa-check"></i>
        </span>
        <input type="text" name="keyword" id="keyword" class="form-control" value="{$param.keyword|default=''}" placeholder="请输入关键词" />
        <span class="input-group-btn">
          <button type="submit" class="btn btn-purple btn-sm">
            <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
            搜索
          </button>
        </span>
      </div>
    </form>
  </div>
  <div class="col-xs-4 col-sm-5">
    <div class="input-group-btn">
      <a href="{:url('[admin.auth.adminer.index]')}">
        <button type="button" class="btn btn-sm  btn-purple">
          <span class="ace-icon fa fa-globe icon-on-right bigger-110"></span>
          显示全部
        </button>
      </a>
    </div>
  </div>
</div>

<div class="row">
  <div class="col-xs-12">
    <table class="table table-striped table-bordered table-hover" id="dynamic-table">
      <thead>
        <tr>
          <th>ID</th>
          <th>账号</th>
          <th>角色</th>
          <th>上次登录时间</th>
          <th>上次登录IP</th>
          <th>创建时间</th>
          <th class="center">操作</th>
        </tr>
      </thead>
      <tbody>
        {foreach $paginate->all() as $key => $adminer }
        <tr>
          <td>{$adminer->id}</td>
          <td>{$adminer->name}</td>
          <td>{$adminer->role_titles}</td>
          <td>{$adminer->login_time|format_show_time=###}</td>
          <td>{$adminer->login_ip}</td>
          <td class="center">{$adminer->create_time}</td>
          <td class="center">
            <a class="green" href="{:url('[admin.auth.adminer.edit]', ['id' => $adminer->id])}">
              <i class="ace-icon fa fa-pencil bigger-130"></i>编辑
            </a>
            <a class="red" herf="javascript:void(0);" onclick="alert_del(this);" data-del-href="{:url('[admin.auth.adminer.delete]', ['id' => $adminer.id])}" data-del-id='{$adminer.id}'>
              <i class="ace-icon fa fa-trash-o bigger-130"></i>删除
            </a>
          </td>
        </tr>
        {/foreach}
      </tbody>
    </table>
    <div>
      <?php echo($paginate->render()); ?>
    </div>
  </div>
</div>
{/block}
